package sort;

import java.util.Scanner;


/*
    5 2 b输
   a 5 2 3
   b 5 2 3 1
   a 5 2 3 1 4

    4 1 a输
   a 4 1 3
   b 4 1 3 2

    2 1 a输掉
   a

   5 3
   a 5 3 2
   b 5 3 2 1
   a 5 4 3 2 1


 */
//未来nio提前批笔试，三道题 两道50 一道0
public class Main {

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] arr=new int[n];
        for (int i=0;i<arr.length;i++)
            arr[i]=i+1;
        process(arr,0,k);
        System.out.println(res%(Math.pow(10,9)+7));
    }
    public static int res=0;
    public static void process(int [] arr,int idx,int k){
        if (idx==arr.length)
            return;
        for (int i=idx;i<arr.length;i++){
            swap(arr,i,idx);
            if (yes(arr,k))
                res+=1;
            swap(arr,i,idx);
        }
    }
    public static void swap(int[] arr,int x,int y){
        int tmp=arr[x];
        arr[x]=arr[y];
        arr[y]=tmp;
    }
    public static boolean yes(int[] arr,int k){
        if (arr[0]>=arr[1])
            return  false;
        int count=0;
        for (int i=0;i<arr.length;i++){
            for (int j=i+1;j<arr.length;j++){
                if (arr[i]>arr[j])
                    count++;
            }
        }
        return count<=k;
    }

}
/*
Scanner scanner=new Scanner(System.in);
        //比赛场次
        int n = scanner.nextInt();
        //最高风险
        int danger = scanner.nextInt();
        int[] normal=new int[n];
        int[] abnormal=new int[n];
        int[] danger_arr=new int[n];
        for (int i=0;i<n;i++){
            normal[i]=scanner.nextInt();
        }
        for (int i=0;i<n;i++){
            abnormal[i]=scanner.nextInt();
        }
        for (int i=0;i<n;i++){
            danger_arr[i]=scanner.nextInt();
        }
        int[][] dp=new int[n][danger+1];
        for (int j=0;j<=danger;j++){
            if (j>=danger_arr[n-1])
                dp[n-1][j]=abnormal[n-1];
            else
                dp[n-1][j]= normal[n-1];
        }
        for (int i=n-2;i>=0;i--){
            for (int j=0;j<=danger;j++){
                dp[i][j]=normal[i]+dp[i+1][j];
                if (j>=danger_arr[i])
                    dp[i][j]=Math.max(dp[i][j],abnormal[i]+dp[i+1][j-danger_arr[i]]);
            }
        }
        System.out.println(dp[0][danger]+1500);
 */


/*
public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T=in.nextInt();
        for (int i=1;i<=T;i++){
            int x=in.nextInt();
            int y=in.nextInt();
            process(x,y);
        }
    }
    public static void process(int x,int y){
        int max=Math.max(x,y);
        if (max%2==0)
            System.out.println("B");
        else
            System.out.println("A");
    }
 */
